const mongoose = require('mongoose');
const Schema = mongoose.Schema;

const NoticeSchema = new Schema({
  noticeId: { type: String, required: true, unique: true },
  title: { type: String, required: true },
  content: { type: String, required: true },
  categoryId: { type: Schema.Types.ObjectId, ref: 'NoticeCategory' },
  createTime: { type: Date, default: Date.now },
  updateTime: { type: Date, default: Date.now },
  flag: { type: Boolean, default: true }
});

module.exports = mongoose.model('Notice', NoticeSchema);
